﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MyShoppingCart.aspx.cs" Inherits="MyShoppingCart_MyShoppingCart" %>


<%@ Register src="../Controls/Head.ascx" tagname="Head" tagprefix="uc1" %>

<%@ Register src="../Controls/Foot.ascx" tagname="Foot" tagprefix="uc2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<link href="../css/website1.css" rel="stylesheet" type="text/css" />
<link href="../css/myshop.css" rel="stylesheet" type="text/css" />
    <title>立言咨询平台-我的购物车</title>
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
    </style>
    <script type="text/javascript" src="../Scripts/jquery-min-lastest.js"></script>
    <script src="../Scripts/jquery-ui-all-min-lastest.js" type="text/javascript"></script>    
    <script type="text/javascript" src="../Scripts/aboutverifycode.js"></script>
    <script type="text/javascript" src="../Scripts/My97DatePicker/WdatePicker.js"></script>
     <script type="text/javascript">
        $(function(){
             var regNumber = /^[1-9]+[0-9]*]*$/  
             var errorCount = 0;
             var carNumArr = null;
             $("input[id*=ImageBrnUpdate]").bind("click",function(){
                //依次验证表格中数据
                $(".NumberValidate").each(function(){
                    errorCount = 0;
                    var $cardNum = $(this).val();
                    if (!regNumber.test($cardNum) || $cardNum == ""){
                        $(this).val(1)
                        errorCount++;
                    }
                });
                if(errorCount > 0){
                    errorCount = 0;
                    alert("购卡张数不能为空且必须大于0！");
                }
             });
         
         });
     </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div id="big">
     <uc1:Head ID="Head1" runat="server" />
     <div id="main">
           <div id="m1"><div id="m11"><a href="../Default.aspx">&nbsp;&nbsp;立言咨询平台</a><a href="MyShoppingCart.aspx">&nbsp;&nbsp;>>我的购物车</a></div></div>
           <div id="m2">
                <%--购物车Grid--%>
                <asp:UpdatePanel ID="UpdatePanelMyGrid" runat="server" EnableViewState="false">
                     <ContentTemplate>
                         <asp:DataGrid ID="DgCat" runat="server" AllowSorting="True" CellPadding="3" 
                            GridLines="Horizontal" AutoGenerateColumns="False" BackColor="White" 
                            BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px">
                            <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
                            <SelectedItemStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
                            <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" 
                                Mode="NumericPages" />
                            <AlternatingItemStyle BackColor="#F7F7F7" />
                            <ItemStyle BackColor="#E7E7FF"  Width="100%" HorizontalAlign="Center" 
                                BorderWidth="1" ForeColor="#121D27" Font-Size="12px" Height="30px" 
                                 Font-Bold="False" Font-Italic="False" Font-Overline="False" 
                                 Font-Strikeout="False" Font-Underline="False" VerticalAlign="Middle"/>
                            
                            <Columns>
                                <asp:BoundColumn DataField="pid" HeaderText="ID" Visible="false" ></asp:BoundColumn>
                                <asp:BoundColumn DataField="Mobile" HeaderText="手机" ReadOnly="True">
                                    <HeaderStyle Width="15%" />
                                </asp:BoundColumn>
                                <asp:BoundColumn DataField="Points" HeaderText="类别" ReadOnly="True">
                                    <HeaderStyle Width="15%" />
                                </asp:BoundColumn>
                                <asp:BoundColumn DataField="PerPrice" HeaderText="单价" DataFormatString="￥{0:N2}" 
                                    ReadOnly="True" ItemStyle-Font-Bold="true" ItemStyle-ForeColor="Red">
                                    <HeaderStyle Width="15%" />
                                    <ItemStyle Font-Bold="True" ForeColor="Red" />
                                </asp:BoundColumn>
                                <asp:TemplateColumn HeaderText="张数">
                                   <ItemTemplate>
                                       <asp:TextBox ID="txtCardNums" runat="server" CssClass="NumberValidate" Text='<%# DataBinder.Eval(Container.DataItem, "CardNums").ToString().Trim() %>' Font-Bold="true" ForeColor="#121d27"></asp:TextBox>
                                   </ItemTemplate>
                                    <HeaderStyle Width="15%" />
                                </asp:TemplateColumn>
                                <asp:ButtonColumn CommandName="Delete" Text="删除"  HeaderText="删除">
                                    <HeaderStyle Width="20%" />
                                </asp:ButtonColumn>
                            </Columns>
                            <HeaderStyle BackColor="#192952" Font-Bold="True" ForeColor="White" 
                                HorizontalAlign="Center" Font-Size="13px" Height="30px"/>
                            
                        </asp:DataGrid> 
                     </ContentTemplate>
                </asp:UpdatePanel>
           </div>
           <div class="xian"></div>
           <div class="xiankong"></div>
           <div id="m3">
           
               <table class="s1"; cellspacing=25px>
                   <tr>
                       <td class="s2">
                        <asp:ImageButton ID="ImgBtnReturn" runat="server" 
                    ImageUrl="~/Images/CardCenterImg/jixugouka.jpg" onclick="ImgBtnReturn_Click" />
                    </td>
					</tr>
					<tr>
                       <td class="s3">
                            <asp:ImageButton ID="ImageBrnUpdate" runat="server" 
                    ImageUrl="~/Images/CardCenterImg/gengxin.jpg" onclick="ImgBtnUpdate_Click" />
                   
                    </td>
					</tr>
					<tr>
                       <td class="s4">
                           <asp:ImageButton ID="ImgBtnClear" runat="server" 
                    ImageUrl="~/Images/CardCenterImg/qingkong.jpg" onclick="ImgBtnClear_Click"/> 
                    </tr>
					<tr>
                    </td>
                       <td class="s5"> 
                         <asp:ImageButton ID="ImgBtnGoOnlinePay" runat="server" 
                    ImageUrl="~/Images/CardCenterImg/shouyingtai.jpg" onclick="ImgBtnGoOnlinePay_Click" />
                    </td>
                   </tr>
               </table>
           
           </div>
     </div>
    <uc2:Foot ID="Foot1" runat="server" /> 
    </div>
    </form>
</body>
</html>
